home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / Misc / Progress Test < prev    next >
Encoding:
Text File  |  1999-03-04  |  1.6 KB  |  57 lines  |  [TEXT/ToyS]

  1. property gasLocation : {40, 60}
  2. property gasLoc2 : {60, 200}
  3.  
  4.  
  5. on run
  6.     set max to 222
  7.     
  8.     set progW to display progress titled "Counting Progress" subtitled ¬
  9.         "Yo yo yo, here we go…" maximum max located at gasLocation
  10.     
  11.     set newLabel to ""
  12.     set altCol to false
  13.     
  14.     repeat with i from 1 to max
  15.         if (i mod 7) = 0 then
  16.             if (newLabel is "Love is …") then
  17.                 set newLabel to "… the seventh wave."
  18.                 set altCol to true
  19.             else
  20.                 set newLabel to "Love is …"
  21.                 set altCol to false
  22.             end if
  23.         end if
  24.         
  25.         if (canceled of (display progress progW value i labeled newLabel alternate color altCol)) then
  26.             set cancer to display dialog "Are you sure you want to quit this awesome demo?" buttons {"Continue", "Quit"} default button 2
  27.             if (the button returned of cancer is "Quit") then
  28.                 beep
  29.                 display progress progW with disposal
  30.                 return 0
  31.             end if
  32.         end if
  33.     end repeat
  34.     
  35.     display progress progW subtitled "Counting again" labeled "Down"
  36.     
  37.     repeat with i from max to 1 by -1
  38.         display progress progW value i
  39.     end repeat
  40.     
  41.     display progress progW labeled "… and back"
  42.     set anotherProgress to display progress titled "Parallel" labeled "Where's my MP?" maximum max * 2 located at gasLoc2
  43.     
  44.     repeat with i from 1 to max * 2
  45.         display progress progW value i
  46.         display progress anotherProgress value i
  47.     end repeat
  48.     
  49.     -- Save window location in property
  50.     set gasLocation to screen location of (display progress progW)
  51.     set gasLoc2 to screen location of (display progress anotherProgress)
  52.     
  53.     -- Close it!    
  54.     display progress progW with disposal
  55.     display progress anotherProgress with disposal
  56. end run
  57.